#!/bin/bash 

bash=0
nologin=0

for name in $(awk -F: '{print $7}' /etc/passwd); do
   if [ $name == "/bin/bash"  ]  ; then
      let bash++
   elif [ $name == "/sbin/nologin"  ]  ; then
      let nologin++
   fi
done 

echo "bash用户数: $bash  ,nologin用户数：$nologin"
